<template>
  <div style="font-size: 16px; text-align: center">
    <span style="padding-left: 100px; font-size: 20px">设置密码</span
    ><span style="padding-left: 80px">跳过</span>

    <van-cell-group style="margin-top: 20px">
      <van-field v-model="password" label="" placeholder="请输入登陆密码" />
    </van-cell-group>
    <van-cell-group>
      <van-field label="" placeholder="请再次输入登陆密码" />
    </van-cell-group>
    <div style="margin: 16px">
      <van-button
        v-model="password"
        round
        block
        type="warning"
        @click="ok"
        native-type="submit"
      >
        登陆
      </van-button>
    </div>
  </div>
</template>

<script>
import { setpassword } from "../../../../../request/http";

export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      arr: [],
      password: "",
    };
  },
  computed: {},
  watch: {},
  created() {
    console.log(this.$route.params);
    this.arr = this.$route.params;
  },
  mounted() {},
  methods: {
    ok() {
      let obj = {
        mobile: this.arr.mobile,
        password: this.password,
        sms_code: this.arr.sms_code,
      };
      setpassword(obj).then((res) => {
        console.log(res);
        if (res == true) {
          this.$toast.success("密码设置成功,跳转个人中心");
          this.$router.push("/home/person");
          
        }
      });
    },
  },
};
</script>

<style lang='scss' scoped>
</style>
